import http from '../index'

const api = '/store/order'

export function get(params) {
  return http.get(api, {
    params
  })
}

export function no(params) {
  return http.get(api + '/no', {
    params
  })
}

export function update(data) {
  return data.id ? http.put(api + '/' + data.id, data) : http.post(api, data)
}

export function del(id) {
  return http.delete(api + '/' + id)
}

export function status(id, code, time) {
  return http.post(api + '/status/' + id, { code, time })
}

export function goods(goods_id, params) {
  return http.get(api + '/goods/' + goods_id, {
    params
  })
}

export function outbound(id) {
  return http.post(api + '/outbound/' + id)
}

export function sum(data) {
  return http.post(api + '/sum', data)
}

export function count(data) {
  return http.post(api + '/count', data)
}

export function total(data) {
  return http.post(api + '/total', data)
}

export function totalTicket(data) {
  return http.post(api + '/total/ticket', data)
}

export function totalGoods(data) {
  return http.post(api + '/total/goods', data)
}

export function copy(data) {
  return http.post(api + '/copy/' + data.id, data)
}
